package com.example.young.peopleaccommodationms;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import DB.OrdersBean;

public class OrdersInfoEnsure extends AppCompatActivity {

    public Button ensure_btn;
    public TextView name_tv;
    public TextView id_tv;
    public TextView starttime_tv;
    public TextView price_tv;
    public TextView roomid_tv;
    public TextView days_tv;
    public TextView prepay_tv;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_orders_info_ensure);

        ensure_btn = (Button) findViewById(R.id.OrdersInfo_Back);
        name_tv = (TextView) findViewById(R.id.OrdersInfo_name_tv);
        id_tv = (TextView) findViewById(R.id.OrdersInfo_id_tv);
        starttime_tv = (TextView) findViewById(R.id.register_starttime_tv);
        price_tv = (TextView) findViewById(R.id.register_price_tv);
        roomid_tv = (TextView) findViewById(R.id.register_roomid_tv);
        days_tv = (TextView) findViewById(R.id.register_days_tv);
        prepay_tv = (TextView) findViewById(R.id.register_prepayments_tv);

        Intent intent = getIntent();
        OrdersBean orders = (OrdersBean) intent.getSerializableExtra("orders");

        name_tv.setText(orders.getName());
        id_tv.setText(orders.getId());
        starttime_tv.setText(orders.getStarttime());
        price_tv.setText(orders.getPrice());
        roomid_tv.setText(orders.getRoomid());
        days_tv.setText(orders.getDays());
        prepay_tv.setText(orders.getPrePay());

        ensure_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(OrdersInfoEnsure.this, HomePage.class);
                startActivity(intent);
            }
        });
    }
}
